home *** CD-ROM | disk | FTP | other *** search
/ Greenhouse Effect Detection Expriment / NASA Greenhouse Effect Detection Expriment 1992 - Disc 2.iso / software / dos / cdf22pc / src / lib / fix512.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-19  |  918 b   |  40 lines

  1. /******************************************************************************
  2. *
  3. *  NSSDC/CDF            Determine if a file has fixed length, 512-byte
  4. *                records (for VMS systems).
  5. *
  6. *  Version 1.1, 1-May-91, ST Systems (STX)
  7. *
  8. *  Modification history:
  9. *
  10. *   V1.0  22-Jan-91, J Love    Original version (for CDF V2.0).
  11. *   V1.1   1-May-91, J Love    Changed to be compatible with VMS 4.7-.
  12. *
  13. ******************************************************************************/
  14.  
  15. #if defined(vms)
  16. #include <stat.h>
  17. #include <fab.h>
  18. #include <stdio.h>
  19.  
  20. int fix512 (file_spec)
  21. char *file_spec;
  22. {
  23. struct stat *stat_t_ptr;                    /* V1.1 */
  24. int yep;
  25.  
  26. stat_t_ptr = (struct stat *) malloc (sizeof(struct stat));    /* V1.1 */
  27. if (stat_t_ptr == NULL) return FALSE;
  28.  
  29. stat (file_spec, stat_t_ptr);
  30. if (stat_t_ptr->st_fab_rfm == FAB$C_FIX && stat_t_ptr->st_fab_mrs == 512)
  31.    yep = TRUE;
  32.  else
  33.    yep = FALSE;
  34.  
  35. free (stat_t_ptr);
  36.  
  37. return yep;
  38. }
  39. #endif
  40.